Skip to content

Fix/brain repo corrections#67

Open
dbadaniel wants to merge 28 commits intoEvolutionAPI:developfrom
dbadaniel:fix/brain-repo-corrections
Open

Fix/brain repo corrections#67
dbadaniel wants to merge 28 commits intoEvolutionAPI:developfrom
dbadaniel:fix/brain-repo-corrections

Conversation

@dbadaniel
Copy link
Copy Markdown

@dbadaniel dbadaniel commented Apr 30, 2026

A criação do brain-repo estava funcionando, mas reconectar não estava. Haviam algumas questões relacionadas ao token e também ao monitoramento do restore.

PS. lembrando que na construção da imagem para o docker precisa colocar o git

image image image image

DavidsonGomes and others added 27 commits April 22, 2026 12:48
… skills

Move Telegram reply() out of skill SKILL.md files into the routine .py
callers via notify_telegram=True on run_skill(). This guarantees exactly
one send per execution — the instruction is appended at the end of the
prompt after all skill steps, so the agent cannot send it early.

- runner.py: add notify_telegram param to run_skill() — reads chat_id
  from TELEGRAM_CHAT_ID env, appends explicit one-shot instruction
- Skills cleaned: prod-end-of-day, prod-good-morning, pulse-faq-sync,
  pulse-daily (custom files gitignored, updated locally)
- Routines updated: end_of_day, good_morning (custom routines gitignored)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Telegram notification was still in the skill file, causing the agent
to call reply() multiple times per run (3x observed on 25/04 at 06:51).

Notification now controlled by notify_telegram=True in review_todoist.py
(gitignored custom routine, already updated on disk).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… cwd

Ticket threads pass workspace_path (e.g. workspace/personal/) as the
session cwd. loadAgentFile was building the path relative to that cwd,
so it looked for .claude/agents/ inside the ticket's folder instead of
the workspace root — always failing for every agent.

Fix: try WORKSPACE_ROOT/.claude/agents/{name}.md first, fall back to
cwd for custom per-directory agents.

Affected: kai-personal-assistant, flux-finance, and any ticket with
a workspace_path set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…template

Root cause: notify_telegram instruction showed reply(chat_id=..., text="...")
as an inline code snippet, causing the agent to execute it immediately on
reading the instruction AND again at the end — 2x per instruction.

Financial Pulse was getting 4x because the skill's Step 8 also contained
a reply() call instruction (2 instructions × 2 executions = 4 messages).

Fixes:
- runner.py: rewrite notify_telegram prompt to describe the action in
  plain text without an inline function-call template
- fin-daily-pulse SKILL.md: remove Step 8 Telegram section — notification
  is handled by the routine caller via notify_telegram=True

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comprehensive sweep of all 175+ skills. Root cause of all duplicate
Telegram notifications: skills contained inline reply(chat_id=...) code
examples that Claude executed immediately on reading, then called again
at the actual end-of-skill step — causing 2x (or 4x when combined with
a second instruction from notify_telegram=True in the routine).

Changes:
- Removed "Notify via Telegram" sections entirely from 10 skills that
  have a corresponding routine using notify_telegram=True:
  fin-weekly-report, gog-email-triage, prod-dashboard, prod-trends,
  pulse-monthly, pulse-weekly, sage-strategy-digest,
  fin-monthly-close-kickoff, social-analytics-report, social-youtube-report

- Rewrote Telegram instructions without inline reply() code in 4 skills
  that are called without notify_telegram (heartbeat or conditional):
  int-sync-meetings, int-github-review, int-linear-review (plain text),
  custom-getfy-sync, custom-omc-sync (plain text, local/gitignored)

The corresponding routines (gitignored) were updated locally to add
notify_telegram=True where the section was removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…finitive fix)

Root cause: prompt instructions cannot reliably prevent Claude from calling
reply() multiple times. No matter how explicit the instruction, the agent
may call the tool on reading it, on output, and again at the end.

Architectural change: Claude never calls Telegram anymore.
1. runner.py run_skill(): Claude is asked to output a TELEGRAM_MSG: line
   in stdout. After the skill returns, Python reads that line and calls
   send_telegram() exactly once via HTTP bot API. Guaranteed 1 message.
2. int-sync-meetings, int-github-review, int-linear-review: replaced
   "use the Telegram tool" with "write TELEGRAM_MSG: as the last line".
3. sync_meetings.py (local): added notify_telegram=True so the runner
   handles the notification.

This makes duplicate Telegram notifications structurally impossible
regardless of how many times Claude mentions or tries to call reply().
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @dbadaniel, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@DavidsonGomes DavidsonGomes changed the base branch from main to develop May 2, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants